package com.jshoperxms.controller.utils.enums;

/**
 * Created by sdywcd on 16/10/25.
 * Des:
 */
public class BasicUserEnums {
    public enum ISTEMP {
        TEMP("临时用户", "1"), FOEVER("永久用户", "2");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private ISTEMP(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String state) {
            for (ISTEMP type : ISTEMP.values()) {
                if (type.getState().equals(state)) {
                    return type.getName();
                }
            }
            return "";
        }
    }


    /**
     * 后台用户数据状态
     *
     * @author sdywcd
     *
     */
    public enum UserStatus {
        ACTIVE("激活", "1"), UNACTIVE("未激活", "0"), LOCK("锁定", "2");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private UserStatus(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String tag) {
            for (UserStatus d : UserStatus.values()) {
                if (d.getState().equals(tag)) {
                    return d.getName();
                }
            }
            return "";
        }
    }



}
